<table class="tableList" style="width:auto">
        <thead>
            <tr>
                <th class="txtLeft dataDescending" style="width:110px;"><a href="#">Disciplina</a></th>
                <th class="dataAscending" style="width:250px;"><a href="#">Total</a></th>
                <?php foreach ($ciclos as $ciclo) { ?>
                    <th style="width:100px;">Ciclo <?= $ciclo->CICLO?> </th>
               <?php }?>

            </tr>
        </thead>

        <tbody>
            
                 <?php 
                 $totalGeral=0;
                 foreach ($disciplinas as $disciplina) { 
                     $codigo=$disciplina['CODIGO'];
                     
                     ?>
                    <tr class="success">
                        <td style="width:100px;"><?= $disciplina['DESCRICAO'] ?> </td>
                        <td style="width:100px;"><?= converterHora($total[$codigo]['TOTAL']) ?> </td>
                        <?php foreach ($ciclos as $ciclo) { 
                            $codCiclo=$ciclo->CICLO;
                            
                            

                            $horaCompleta= converterHora($subTotal[$codigo][$codCiclo]['subTotal']);
                            ?>
                            <td style="width:100px;"><?=  $horaCompleta?> </td>
                            
                        <?php 
                        $totalGeral+=$subTotal[$codigo][$codCiclo]['subTotal'];
                        }
                        //$totalGeral=  converterHora($totalGeral);
                        ?>
                    </tr>
               <?php }?>
          
        </tbody>
    </table>

<h4>Total de Horas estudas no projeto: <b><?=  converterHora($totalGeral)?></b></h4>

    <?php
    function converterHora($seconds){
        $hours = floor($seconds / 3600);
        $seconds -= $hours * 3600;
        $minutes = floor($seconds / 60);
        $seconds -= $minutes * 60;
        $retHora="";
        $retMinuto="";
        if ($hours>0){
            $retHora="$hours h";
        }
        if ($minutes>0){
            $retMinuto="$minutes min";
        }
        return $horaCompleta = "$retHora $retMinuto";
    }
    ?>
